package com.java.set;

import java.util.Set;

/**
 * @author shkstart
 * @create 2021-01-18 14:32
 */
public class HashSet {
    public static void main(String[] args) {

        Set s1 = new java.util.HashSet();
        com.java.set.Person p1 = new com.java.set.Person(1001, "AA");
        com.java.set.Person p2 = new com.java.set.Person(1002, "BB");

        s1.add(p1);
        s1.add(p2);
        System.out.println(s1);

        p1.name = "CC";
        s1.remove(p1);
        System.out.println(s1);

        s1.add(new com.java.set.Person(1001, "CC"));
        System.out.println(s1);


        s1.add(new com.java.set.Person(1001, "AA"));
        System.out.println(s1);


    }
}
